<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Express template</title>
	<link rel="stylesheet" type="text/css" href="/node_modules/bootstrap/dist/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/public/css/main.css">
</head>
<body>
	<div class="container">
		<div class="header">
			<h1>Hello Nodejs</h1>
			<h2>学生列表</h2>
		</div>
		<br><hr>
		<div class="main">
			<div class="table-list">
				<a href="/students/new" class="btn btn-success">添加学生</a>
			</div>
			<table class="table table-striped table-hover table-sm">
			  <thead>
			    <tr>
			      <th scope="col">#</th>
			      <th scope="col">姓名</th>
			      <th scope="col">性别</th>
			      <th scope="col">年龄</th>
			      <th scope="col">爱好</th>
			      <th scope="col">操作</th>
			    </tr>
			  </thead>
			  <tbody>
			  	{{ each students}}
				    <tr>
				      <th scope="row">{{ $value.id }}</th>
				      <td>{{ $value.name }}</td>
				      <td>{{ $value.gender }}</td>
				      <td>{{ $value.age }}</td>
				      <td>{{ $value.hobbies }}</td>
				      <td>
								<a href="/students/edit?id={{ $value.id }}">编辑</a>
								&nbsp;&nbsp;
								<a href="/students/delete?id={{ $value.id }}">删除</a>
				      </td>
				    </tr>
			  	{{ /each }}
			  </tbody>
			</table>
		</div>
	</div>
</body>
</html>